#include <iostream>
#include <memory>
using namespace std;

class car;

class Person
{
public:
    Person()
    {
        cout << "Person()" << endl;
    }

    ~Person()
    {
        cout << "~Person()" << endl;
    }
    shared_ptr<car> m_car = nullptr;
};

class car
{
public:
    car()
    {
        cout << "car()" << endl;
    }

    ~car()
    {
        cout << "~car()" << endl;
    }
private:
    shared_ptr<Person> m_person = nullptr;
};

int main()
{
    shared_ptr<Person> person(new Person());
    shared_ptr<car> Car(new car());
    person->m_car = car;
}